package com.hspedu.homework;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @author LiuJinTao
 * @className HomeWork03
 * @date 2024/06/14 11:06
 * @description TODO
 */
public class HomeWork03 {
    public static void main(String[] args) {
        HashMap map = new HashMap();
        map.put("jack", 650);
        map.put("tom", 1200);
        map.put("smith", 2900);
        System.out.println("map=" + map);

        map.replace("jack", 2600);
        System.out.println("map=" + map);


        Set set = map.keySet();
        for (Object o : set) {
            map.replace(o, (int) map.get(o) + 100);
        }


        Set entrySet = map.entrySet();
        for (Object o : entrySet) {
            Map.Entry entry = (Map.Entry) o;
            System.out.println(entry.getKey() + "-" + entry.getValue());
        }


    }
}
